﻿--获取岗位类别
CREATE PROCEDURE [dbo].[proc_Post_Category_GetList]
(
	@StartIndex int,
	@EndIndex int
)
as
	Begin
	;WITH list as (Select ROW_NUMBER() OVER (ORDER BY Id)AS Row
		,Id
		,IsNull(ParentId,0) as ParentId
		,Title
		,Number
		,Sort
		,UpTime
--		,(Select Count(Id) From Post_Category Where ParentId=0) AS coun
		From Post_Category
		Where 
				ParentId=0
	)
	Select *,(SELECT COUNT(0) FROM list) AS coun From list Where Row between @StartIndex and @EndIndex ORDER BY Sort
	End
	RETURN
